/************************************************
 * Copyright (c) 2007 ~ 2009, 
 * All rights reserved.
 * Version   : 1.0
 * Author    : lengsh@gmail.com 
 * Date      : 2009.2.1
 ***********************************************/

#ifndef  __PANDA_H_____
#define  __PANDA_H_____
 
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <event.h>
#include <netdb.h>
#include <stdint.h>
#include <unistd.h>
#include "AntDefine.h"
/*
 * Functions
 */

void Conn_Set_State(conn *c, int state) ;
bool Update_Event(conn *c, const int new_flags) ;
void Accept_New_Connection(const bool do_accept) ;
void Handler_Dispatch(conn *c);
void Thread_Event_Handler(const int fd, const short which, void *arg) ;
void * Thread_Worker_Start(void *arg);
void Thread_OnRead_Process(int fd, short which, void *arg);

#endif
